<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!-- <script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAB9Zi6HoFK1JEZzpmN7jdZRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT3JyV8f4cdF4VSHAcKuRJE-SclbQ"></script>-->
<script type="text/javascript"
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
	$("input[\"name=submitButton\"]").die()
	$("input[\"name=submitButton\"]").live("click", function() {
		$("#actionForm").val($(this).attr('id'));
		$("#productForm").submit();
	});
</script>
</head>
<body>
	<div>
		<p>
			Liste des produits<br />
		</p>
		<table>
			<tr>
				<td>ID</td>
				<td>Nom</td>
				<td>Description</td>
				<td>Actions</td>
			</tr>

			<c:forEach var="entry" items="${productsList}">
				<tr>
					<td>${ entry.id }</td>
					<td>${ entry.name }</td>
					<td>${ entry.description }</td>
					<td><a href="./update.html?id=${ entry.id }">Mettre à jour</a> / <a href="./delete.html?id=${ entry.id }">Supprimer</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
	<div>
		<a href="./create.html">Créer un product</a>
	</div>
</body>
</html>